<?php
/**
 * Created by PhpStorm.
 * User: lihuaer
 * Date: 2015/9/20 0020
 * Time: 上午 8:36
 */

namespace Resource\Behavior;


class UrlSuffixBehavior
{
    public function run(&$params)
    {
        C('URL_DENY_SUFFIX', '');
        C('URL_HTML_SUFFIX', 'dir');
        $PATH_INFO = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
        if ($PATH_INFO) {
            define('BUCKET_FILE_PATH', $PATH_INFO);
            $pos = strrpos($PATH_INFO, '.');
            if ($pos !== FALSE) {
                $suffix = substr($PATH_INFO, $pos + 1);
                C('URL_HTML_SUFFIX', $suffix);
            }

        }
        defined('BUCKET_FILE_PATH') or define('BUCKET_FILE_PATH', '');

    }
}